/**
 * 负责用户交互逻辑
 *
 * Created by erichua on 2019-04-23T03:47:50.328Z.
 */
import React, { Component } from 'react'
import { View, Text, Button } from 'react-native'
import { AppNavigator, WeBaseScene } from '@webank/trident'

export default class DemoScene extends WeBaseScene {
  static navigationOptions = ({ navigation: { state: { params = {} } } }) => ({
    headerTitle: '首页'
  })

  constructor (props) {
    super(props)
  }

  onPause (fromScene, toScene) {
    super.onPause(fromScene, toScene)
  }

  onResume (fromScene, toScene) {
    super.onResume(fromScene, toScene)
  }

  render () {
    const {
      balance
    } = this.props
    return (
      <View>
        <View style={{
          margin: 10,
          padding: 10,
          borderWidth: 1,
          backgroundColor: '#FFFFFF'
        }}>
          <View style={{
            flexDirection: 'row',
            justifyContent: 'space-between'
          }}>
            <Text>银行卡8888</Text>
            <Text>¥{balance}</Text>
          </View>
          <View style={{
            flexDirection: 'row',
            justifyContent: 'flex-end',
            marginTop: 10
          }}>
            <Button title={'转入'} onPress={() => {

            }} />
            <Button title={'转出'} onPress={() => {
              AppNavigator.transfer.TransferOutScene({
                balance: balance
              })
            }} />
          </View>
        </View>
      </View>
    )
  }
}
